package org.anno.chunkdb;

import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.servlet.GuiceServletContextListener;
import com.google.inject.servlet.ServletModule;

/**
 * Configures servlets and Guice bindings.
 */
public class MainServletConfig extends GuiceServletContextListener {

  protected Injector getInjector() {
    return Guice.createInjector(new ServletModule() {

      protected void configureServlets() {
        serve("/upload").with(UploadServlet.class);
        serve("/table/*").with(TableServlet.class);
        serve("/sql").with(QueryServlet.class);
      }
    });
  }
}
